package gdut.jmxywz.action;

import gdut.jmxywz.been.AllProject;
import gdut.jmxywz.been.Dissertation;
import gdut.jmxywz.been.Horizontal;
import gdut.jmxywz.been.Teacher;
import gdut.jmxywz.been.Vertical;
import gdut.jmxywz.util.PageModel;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.hibernate.Query;

import com.opensymphony.xwork2.ActionContext;


/**
 * @说明 此方法用于分页查询
 * @param 需要参数objectName，查询条件名称value，查询条件condiction，排序方式ascorDesc
 * 当前页数currentPage，每页记录数pageSize
 * @author 宋樟潮
 * */
public class QueryStatisticsAction extends BaseAction {
	
	private Teacher teacher;
	private  static final String  TEACHER_SESSION_KEY = "teacherSessionKey";
	/**
	 * @说明 论文统计查询
	 */
	private Dissertation dissertation;
    private int disId;
    private String title;
    private String author1;
    private String ei;
    private String sci;
    private String istp;
    private String corePeriodical;
    /**
     * @说明 项目统计查询
     * 包括横向和纵向项目
     */
    private Horizontal horizontal;	
	private int horId;
	private Vertical vertical;
	private int verId;
    
	private AllProject allProject;
	private int proId;
	private String proTitle;
	private String proType;
	private String Num;
	private Date   proTime;
	private String   account;
	private long   receive;
	private String principal;
	
	private PageModel pm = new PageModel();
	private int currentPage;
	private int pageSize;
	private int totalPage;
	private int totalCount;
	private String nextPage;
	private String teacherName;
	
	/**查询条件*/
	private String proAccount;
	private String proReceive;
	
	private String query1;
	private String query2;
	private String query3;
	private String keyword1;
	private String keyword2;
	private String keyword3;
	
	private String connect1;
	private String connect2;
	
	private String con1;
	private String con2;
	private String con3;
	
	/**说明 用于论文的数据统计查询**/
	long sumPaper=0;
	long sumSCI=0;
	long sumEI=0;
	long sumISTP=0;
	long sumCorePeriodical = 0;
	
	/**
	 * 项目数、横向和纵向项目数及各自的金额
	 */
	 int sumProject;
	 int sumVer;
	 int sumHor;
	 long allAccount=0;
	 long verAccount=0;
	 long horAccount=0;
	/**
	 * 项目经费统计查询
	 */
	 long allReceive=0;
	 long verReceive=0;
	 long horReceive=0;
	
	/**
	 * @说明 用于论文的数据统计查询
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public String statisticsQuery() throws Exception{
		
		String hql = "from Dissertation dissertation  where auditing != 0 order by publishYear desc " ;
		
		
		List<Dissertation> list1 = this.getCommonService().findListByHql(hql, null);
		
		for(int i=0;i<list1.size();i++){
		if(list1.get(i).getSci()!=null&&!"".equals(list1.get(i).getSci())){
		sumSCI= sumSCI+1;
		}
		if(list1.get(i).getEi()!=null&&!"".equals(list1.get(i).getEi())){
			sumEI= sumEI+1;
			}
		if(list1.get(i).getIstp()!=null&&!"".equals(list1.get(i).getIstp())){
			sumISTP= sumISTP+1;
			}
		if("是".equals(list1.get(i).getCorePeriodical())){
			sumCorePeriodical= sumCorePeriodical+1;
			}
		}
		sumPaper = sumSCI+sumEI+sumISTP;
		
		
		/*ServletActionContext.getRequest().setAttribute("sum", sumPaper);
		ServletActionContext.getRequest().setAttribute("sumSCI", sumSCI);
		ServletActionContext.getRequest().setAttribute("sumEI", sumEI);
		ServletActionContext.getRequest().setAttribute("sumISTP", sumISTP);
		ServletActionContext.getRequest().setAttribute("sumCorePeriodical",sumCorePeriodical);*/
		
		//ServletContext.getRequestDispatcher("DissertationStatistics.action").forward(request, response);
		//ServletRequest.getRequestDispatcher("DissertationStatistics.action");
		//ServletContext.getRequestDispatcher("smserror.jsp").forward(request,response);
		return SUCCESS;
	}
	
	
	/**
	 * 查询统计--科研论文列表
	 * @return
	 * @throws Exception
	 */
	public String DissertationStatistics() throws Exception{
		if(currentPage<=0){
			currentPage=1;
		}
		if(pageSize<=0){
			pageSize=15;
		}
		teacher = (Teacher) ActionContext.getContext().getSession().get(TEACHER_SESSION_KEY);
		//if(teacher!=null&&!"".equals(teacher)){
	//	String tName = teacher.getTeacherName();
		//System.out.println(tName);
		String hql = "from Dissertation dissertation where auditing != 0 " ;
		
		if(title!=null&&!"".equals(title)){
			hql = hql+" and title like '%"+title+"%' ";
		}
		if(author1!=null&&!"".equals(author1)){
			hql = hql+" and author1 like '%"+author1+"%' ";
		}
		
		if("ei".equals(ei)){
			hql = hql+" and ei >'0' ";
		}
		if("sci".equals(sci)){
			hql = hql+" and sci >'0' ";
		}
		if("istp".equals(istp)){
			hql = hql+" and istp >'0' ";
		}
		
		if(corePeriodical!=null&&!"".equals(corePeriodical)){
			if("是".equals(corePeriodical)){
			hql = hql+" and corePeriodical ='是' ";
			}else{
				hql= hql+" and corePeriodical ='否' ";
			}
			
		}
		
		 
		
		pm = this.getCommonService().findPage(hql, null, currentPage, pageSize, null, null);
	
		return SUCCESS;
		//}else{
		//	return "login";
	//	}
	}
	
	
	
	
	
	/**
	 * 
	 * @author szc
	 * @说明 查看论文详细信息
	 * @return
	 */
	public String paperDetail() throws Exception{
		
		if(disId!=0){
			dissertation = (Dissertation)this.getCommonService().findByIntId(disId, "gdut.jmxywz.been.Dissertation");
			return SUCCESS;
		}else{
		
		return "login";
		}
	}
	
	
	
	
	/**
	 * @说明 项目数据统计查询
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public String proStatistics() throws Exception{
		

		if(currentPage<=0){
			currentPage=1;
		}
		if(pageSize<=0){
			pageSize=10;
		}
		String hql1 = "from Horizontal where auditing != 0";
		String hql2 = "from Vertical where auditing != 0";
		 
	
		List<Horizontal> HorList =this.getCommonService().findListByHql(hql1, null);
		 List<Vertical> VerList = this.getCommonService().findListByHql(hql2, null);
		 PageModel pmHor = this.getCommonService().findPage(hql1, null, currentPage, pageSize, "projectQuery.action", "");
		 PageModel pmVer = this.getCommonService().findPage(hql2, null, currentPage, pageSize, "projectQuery.action", "");
		 
		 /**分页参数*/
		int totalPage = pmHor.getTotalPage()+ pmVer.getTotalPage();
		int totalCount = pmHor.getTotalCount()+pmVer.getTotalCount();
		
		/**
		 * 计算项目数、横向和纵向项目数及各自的金额
		 */
		  sumProject=0;
		  sumVer=0;
		  sumHor=0;
		  allAccount=0;
		  verAccount=0;
		  horAccount=0;
		 
		 sumVer = pmHor.getTotalCount();
		 sumHor = pmVer.getTotalCount();
		 sumProject = sumVer+sumHor;
		
			 
		 for(int i=0;i<HorList.size();i++){
		
			 horAccount =horAccount+ HorList.get(i).getHorAccount();
		 }
		 for(int i=0;i<VerList.size();i++){
				
			 verAccount =verAccount+ VerList.get(i).getVerAccount();
		 }
		 /**项目总金额*/
		 allAccount = horAccount + verAccount;
		 
		/* ServletActionContext.getRequest().getSession().setAttribute("sumProject", sumProject);
		 ServletActionContext.getRequest().getSession().setAttribute("sumVer", sumVer);
		 ServletActionContext.getRequest().getSession().setAttribute("sumHor", sumHor);
		 ServletActionContext.getRequest().getSession().setAttribute("allAccount", allAccount);
		 ServletActionContext.getRequest().getSession().setAttribute("verAccount", verAccount);
		 ServletActionContext.getRequest().getSession().setAttribute("horAccount", horAccount);
		 */
		 ServletActionContext.getRequest().setAttribute("totalPage", totalPage);
		 ServletActionContext.getRequest().setAttribute("totalCount", totalCount);
		
		return SUCCESS;
	}
	
	
	
	/**
	 * @说明 项目列表
	 * @return success
	 * @throws Exception
	 */
	
	 @SuppressWarnings("unchecked")
	public String listProject() throws Exception{
		 
			int pageSize1=0;
			
			if(currentPage<=0){
				currentPage=1;
			}
			if(pageSize<=0){
				pageSize=15;
			}
			if(pageSize%2==0){
			   pageSize1=pageSize/2;
			}else{
			   pageSize1=pageSize/2+1;
			}
			
			String hql1 = "from Horizontal where auditing != 0";
			String hql2 = "from Vertical where auditing != 0";
			 
		 
			 PageModel pmHor = this.getCommonService().findPage(hql1, null, currentPage, pageSize1-1, "projectQuery.action", "");
			 PageModel pmVer = this.getCommonService().findPage(hql2, null, currentPage, pageSize1, "projectQuery.action", "");
			 
			 /**分页参数*/
			 if( (pmHor.getTotalCount()+ pmVer.getTotalCount() )%pageSize==0 ){
			 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize;
			 }else{
				 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize+1;
			 }
			 totalCount = pmHor.getTotalCount()+pmVer.getTotalCount();
			
			 List<Horizontal> list1 = pmHor.getList();
				List<Vertical> list2 = pmVer.getList();
				
				 List<AllProject> list = new ArrayList<AllProject>();
					
					 	AllProject allProject = null;
					 	if(list1!=null){
						 for(Horizontal hor:list1){
							 allProject = new AllProject();
							 allProject.setProId(hor.getHorId());
							 allProject.setProTitle(hor.getHorTitle());
							 allProject.setProType("横向");
							 allProject.setProTime(hor.getHorTime());
							 allProject.setNum(hor.getHorNum());
							 allProject.setAccount(hor.getHorAccount());
							 allProject.setReceive(hor.getHorRec());
							 allProject.setPrincipal(hor.getHorPrincipal());
							 list.add(allProject);
						 }
					 	}
					 	if(list2!=null){
						 for(Vertical ver:list2){
							 allProject = new AllProject();
							 allProject.setProId(ver.getVerId());
							 allProject.setProTitle(ver.getVerTitle());
							 allProject.setProType("纵向");
							 allProject.setProTime(ver.getVerTime());
							 allProject.setNum(ver.getVerNum());
							 allProject.setAccount(ver.getVerAccount());
							 allProject.setReceive(ver.getVerRec());
							 allProject.setPrincipal(ver.getVerPrincipal());
							 list.add(allProject);
						 }
					 	}
					 	Collections.sort(list, new Comparator<AllProject>(){ //对list里的记录进行排序
					 		@Override
					 	public int compare(AllProject a1,AllProject a2){
					 		
					 		return a2.getProTime().compareTo(a1.getProTime());
					 	 }
					 	});
					 	
				ActionContext.getContext().put("list", list);
		 
		 return SUCCESS;
	 }
	
	
	 /**
	  * @说明 根据条件查询项目
	  * @return
	  * @throws Exception
	  * @author szc
	  */
	
	@SuppressWarnings("unchecked")
	public String queryProject() throws Exception{
	try{	
		/*****查询条件***/
		String[] query = {query1,query2,query3};
		String[] value = {keyword1,keyword2,keyword3};
		String[] connect = {connect1,connect2};
		String[] con = {con1,con2,con3};
		
		int pageSize1=0;
		
		if(currentPage<=0){
			currentPage=1;
		}
		if(pageSize<=0){
			pageSize=15;
		}
		if(pageSize%2==0){
		   pageSize1=pageSize/2;
		}else{
		   pageSize1=pageSize/2+1;
		}
		
	
		
		 
		 //判断项目类型
		if("".equals(proType)||null==proType){
			
			String hql1 = "from Horizontal where auditing != 0";
			String hql2 = "from Vertical where auditing != 0";
			 
		 
			 PageModel pmHor = this.getCommonService().findPage(hql1, null, currentPage, pageSize1-1, "queryProject.action", "");
			 PageModel pmVer = this.getCommonService().findPage(hql2, null, currentPage, pageSize1, "queryProject.action", "");
			 
			 /**分页参数*/
			 if( (pmHor.getTotalCount()+ pmVer.getTotalCount() )%pageSize==0 ){
			 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize;
			 }else{
				 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize+1;
			 }
			 totalCount = pmHor.getTotalCount()+pmVer.getTotalCount();
			
		for(int i=0;i<3;i++){
			if(null!=value[i]&&!"".equals(value[i])){
				if("proTitle".equals(query[i])){
						if("like".equals(con[i])){
							if(i==0){
								hql1 = hql1 +" and  horTitle like '%"+value[i]+"%'";
								hql2 = hql2 +" and  verTitle like '%"+value[i]+"%'";
							}else{
								hql1 = hql1 +" "+connect[i-1]+"  horTitle like '%"+value[i]+"%'";
								hql2 = hql2 +" "+connect[i-1]+"  verTitle like '%"+value[i]+"%'";
								}
							}else{
								if(i==0){
									hql1 = hql1 +" and  horTitle = '"+value[i]+"' ";
									hql2 = hql2 +" and  verTitle = '"+value[i]+"' ";
								}else{
									hql1 = hql1 +" "+connect[i-1]+"  horTitle = '"+value[i]+"' ";
									hql2 = hql2 +" "+connect[i-1]+"  verTitle = '"+value[i]+"' ";
									}
							  }
						  }
				if("principal".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql1 = hql1 +" and  horPrincipal like '%"+value[i]+"%'";
							hql2 = hql2 +" and  verPrincipal like '%"+value[i]+"%'";
						}else{
							hql1 = hql1 +" "+connect[i-1]+"  horPrincipal like '%"+value[i]+"%'";
							hql2 = hql2 +" "+connect[i-1]+"  verPrincipal like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql1 = hql1 +" and  horPrincipal = '"+value[i]+"' ";
								hql2 = hql2 +" and  verPrincipal = '"+value[i]+"' ";
							}else{
								hql1 = hql1 +" "+connect[i-1]+"  horPrincipal = '"+value[i]+"' ";
								hql2 = hql2 +" "+connect[i-1]+"  verPrincipal = '"+value[i]+"' ";
								}
						  }
					
					  }
				if("account".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql1 = hql1 +" and horAccount like '%"+value[i]+"%'";
							hql2 = hql2 +" and verAccount like '%"+value[i]+"%'";
						}else{
							hql1 = hql1 +" "+connect[i-1]+" horAccount like '%"+value[i]+"%'";
							hql2 = hql2 +" "+connect[i-1]+" verAccount like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql1 = hql1 +" and horAccount = '"+value[i]+"'";
								hql2 = hql2 +" and verAccount = '"+value[i]+"'";
							}else{
								hql1 = hql1 +" "+connect[i-1]+" horAccount = '"+value[i]+"' ";
								hql2 = hql2 +" "+connect[i-1]+" verAccount = '"+value[i]+"' ";
								}
						  }
					  }
				if("proTime".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql1 = hql1 +" and  horTime like '%"+value[i]+"%'";
							hql2 = hql2 +" and  verTime like '%"+value[i]+"%'";
						}else{
							hql1 = hql1 +" "+connect[i-1]+"  horTime like '%"+value[i]+"%'";
							hql2 = hql2 +" "+connect[i-1]+"  verTime like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql1 = hql1 +" and  horTime = '"+value[i]+"'";
								hql2 = hql2 +" and  verTime = '"+value[i]+"'";
							}else{
								hql1 = hql1 +" "+connect[i-1]+"  horTime = '"+value[i]+"'";
								hql2 = hql2 +" "+connect[i-1]+"  verTime = '"+value[i]+"'";
								}
							
						}
					 }
				}
					
			}
		
	
		// PageModel pm1 = this.getCommonService().findPage(hql1, null, currentPage, pageSize-1, "projectQuery.action", "");
		// PageModel pm2 = this.getCommonService().findPage(hql2, null, currentPage, pageSize, "projectQuery.action", "");
		 
		List<Horizontal> list1 = pmHor.getList();
		List<Vertical> list2 = pmVer.getList();
		
		 List<AllProject> list = new ArrayList<AllProject>();
			/* if(list1!=null){
				 Iterator it1 = list1.iterator();
				 if(it1.hasNext()){
					 AllProject allProject =(AllProject)it1.next();
					 list.add(allProject);
			 }
			 }*/
			 	AllProject allProject = null;
			 	if(list1!=null){
				 for(Horizontal hor:list1){
					 allProject = new AllProject();
					 allProject.setProId(hor.getHorId());
					 allProject.setProTitle(hor.getHorTitle());
					 allProject.setProType("横向");
					// proType = "横向";
					 allProject.setProTime(hor.getHorTime());
					 allProject.setNum(hor.getHorNum());
					 allProject.setAccount(hor.getHorAccount());
					 allProject.setReceive(hor.getHorRec());
					 allProject.setPrincipal(hor.getHorPrincipal());
					 //Num = hor.getHorNum();
					// account = hor.getHorAccount();
					// principal = hor.getHorPrincipal();
					 //allProject.setProId(1);
					 list.add(allProject);
				 }
			 	}
			 	if(list2!=null){
				 for(Vertical ver:list2){
					 allProject = new AllProject();
					 
//					 proTitle = ver.getVerTitle();
//					 proType = "纵向";
					 allProject.setProId(ver.getVerId());
					 allProject.setProTitle(ver.getVerTitle());
					 allProject.setProType("纵向");
					 allProject.setProTime(ver.getVerTime());
					 allProject.setNum(ver.getVerNum());
					 allProject.setAccount(ver.getVerAccount());
					 allProject.setReceive(ver.getVerRec());
					 allProject.setPrincipal(ver.getVerPrincipal());
					 list.add(allProject);
				 }
			 	}
			 	Collections.sort(list, new Comparator<AllProject>(){ //对list里的记录进行排序
			 		@Override
			 	public int compare(AllProject a1,AllProject a2){
			 		
			 		return a2.getProTime().compareTo(a1.getProTime());
			 	 }
			 	});
			 	
				 ActionContext.getContext().put("list", list);
				/* for(int i=0;i<list1.size();i++){
					 Iterator iter = list.iterator();
					 list.get(i).setAccount(list1.get(i).getHorAccount());
					 list.get(i).setNum(list1.get(i).getHorNum());
				 }
				*/
		 
		}else if("横向".equals(proType)){
			
			//选择的是横向项目
			
		 String hql = "from Horizontal where auditing != 0";
		
		for(int i=0;i<3;i++){
			if(null!=value[i]&&!"".equals(value[i])){
				if("proTitle".equals(query[i])){
						if("like".equals(con[i])){
							if(i==0){
								hql = hql +" and  horTitle like '%"+value[i]+"%'";
							}else{
								hql = hql +" "+connect[i-1]+"  horTitle like '%"+value[i]+"%'";
								}
							}else{
								if(i==0){
									hql = hql +" and  horTitle = '"+value[i]+"' ";
								}else{
									hql = hql +" "+connect[i-1]+"  horTitle = '"+value[i]+"' ";
									}
							  }
						  }
				if("principal".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and  horPrincipal like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+"  horPrincipal like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and  horPrincipal = '"+value[i]+"' ";
							}else{
								hql = hql +" "+connect[i-1]+"  horPrincipal = '"+value[i]+"' ";
								}
						  }
					
					  }
				if("account".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and horAccount like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+" horAccount like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and horAccount = '"+value[i]+"'";
							}else{
								hql = hql +" "+connect[i-1]+" horAccount = '"+value[i]+"' ";
								}
						  }
					  }
				if("proTime".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and  horTime like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+"  horTime like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and  horTime = '"+value[i]+"'";
							}else{
								hql = hql +" "+connect[i-1]+"  horTime = '"+value[i]+"'";
								}
							
						}
					 }
				}
					
			}
		 
		  pm = this.getCommonService().findPage(hql, null, currentPage, pageSize, "queryProject.action", "");
		  totalPage= pm.getTotalPage();
		  totalCount =pm.getTotalCount();
		  
		  List<Horizontal> list1 = pm.getList();
			
			 List<AllProject> list = new ArrayList<AllProject>();
			 	if(list!=null){
				 	AllProject allProject = null;
					 for(Horizontal hor:list1){
						 allProject = new AllProject();
						 allProject.setProId(hor.getHorId());
						 allProject.setProTitle(hor.getHorTitle());
						 allProject.setProType("横向");
						 allProject.setProTime(hor.getHorTime());
						 allProject.setNum(hor.getHorNum());
						 allProject.setAccount(hor.getHorAccount());
						 allProject.setReceive(hor.getHorRec());
						 allProject.setPrincipal(hor.getHorPrincipal());
						 list.add(allProject);
					 }
			 	}
			 	Collections.sort(list, new Comparator<AllProject>(){ //对list里的记录进行排序
			 		@Override
			 	public int compare(AllProject a1,AllProject a2){
			 		
			 		return a2.getProTime().compareTo(a1.getProTime());
			 	 }
			 	});
			ActionContext.getContext().put("list", list);
		 
		}else{
			
			/****选择的是纵向项目**/
			
	   String hql = "from Vertical where auditing != 0";
	   
	   for(int i=0;i<3;i++){
			if(null!=value[i]&&!"".equals(value[i])){
				if("proTitle".equals(query[i])){
						if("like".equals(con[i])){
							if(i==0){
								hql = hql +" and  verTitle like '%"+value[i]+"%'";
							}else{
								hql = hql +" "+connect[i-1]+"  verTitle like '%"+value[i]+"%'";
								}
							}else{
								if(i==0){
									hql = hql +" and  verTitle = '"+value[i]+"' ";
								}else{
									hql = hql +" "+connect[i-1]+"  verTitle = '"+value[i]+"' ";
									}
							  }
						  }
				if("principal".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and  verPrincipal like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+"  verPrincipal like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and  verPrincipal = '"+value[i]+"' ";
							}else{
								hql = hql +" "+connect[i-1]+"  verPrincipal = '"+value[i]+"' ";
								}
						  }
					
					  }
				if("account".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and verAccount like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+" verAccount like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and verAccount = '"+value[i]+"'";
							}else{
								hql = hql +" "+connect[i-1]+" verAccount = '"+value[i]+"' ";
								}
						  }
					  }
				if("proTime".equals(query[i])){
					if("like".equals(con[i])){
						if(i==0){
							hql = hql +" and  verTime like '%"+value[i]+"%'";
						}else{
							hql = hql +" "+connect[i-1]+"  verTime like '%"+value[i]+"%'";
							}
						}else{
							if(i==0){
								hql = hql +" and  verTime = '"+value[i]+"'";
							}else{
								hql = hql +" "+connect[i-1]+"  verTime = '"+value[i]+"'";
								}
							
						}
					 }
				}
					
			}
	  
	   pm = this.getCommonService().findPage(hql, null, currentPage, pageSize, "projectQuery.action", "");
	   totalPage= pm.getTotalPage();
	   totalCount =pm.getTotalCount();
		List<Vertical> list2 = pm.getList();
		
		 List<AllProject> list = new ArrayList<AllProject>();
		
		 AllProject allProject = null;
		 for(Vertical ver:list2){
			 allProject = new AllProject();
			 allProject.setProId(ver.getVerId());
			 allProject.setProTitle(ver.getVerTitle());
			 allProject.setProType("纵向");
			 allProject.setProTime(ver.getVerTime());
			 allProject.setNum(ver.getVerNum());
			 allProject.setAccount(ver.getVerAccount());
			 allProject.setReceive(ver.getVerRec());
			 allProject.setPrincipal(ver.getVerPrincipal());
			 list.add(allProject);
		 }
		 Collections.sort(list, new Comparator<AllProject>(){ //对list里的记录进行排序
		 		@Override
		 	public int compare(AllProject a1,AllProject a2){
		 		
		 		return a2.getProTime().compareTo(a1.getProTime());
		 	 }
		 	});
		 	ActionContext.getContext().put("list", list);
			
		}
	 }catch(Exception e){
		 e.printStackTrace();
	 }
	 
		return SUCCESS;
		 
	}
	
	/**
	 * @说明 项目经费查询条件
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public String accountStatistics() throws Exception{
		
		if(currentPage<=0){
			currentPage=1;
		}
		if(pageSize<=0){
			pageSize=10;
		}
		String hql1 = "from Horizontal where auditing != 0";
		String hql2 = "from Vertical where auditing != 0";
	
		 List<Horizontal> HorList =this.getCommonService().findListByHql(hql1, null);
		 List<Vertical> VerList = this.getCommonService().findListByHql(hql2, null);
		
		 PageModel pm1 = this.getCommonService().findPage(hql1, null, currentPage, pageSize, "", "");
		 PageModel pm2 = this.getCommonService().findPage(hql2, null, currentPage, pageSize, "", "");
		/**
		 * 计算项目数、横向和纵向项目数及各自的金额
		 */
		
		 sumVer = pm1.getTotalCount();
		 sumHor = pm2.getTotalCount();
		 sumProject = sumVer+sumHor;
		
			 
		 for(int i=0;i<HorList.size();i++){
			 //横向项目总合同金额
			 horAccount =horAccount+ HorList.get(i).getHorAccount();
		 }
		 for(int i=0;i<HorList.size();i++){
			 //横向项目总到校金额
			 horReceive =horReceive+ HorList.get(i).getHorRec();
		 }
		 for(int i=0;i<VerList.size();i++){
			 //纵向项目总合同金额
			 verAccount =verAccount+ VerList.get(i).getVerAccount();
		 }
		 for(int i=0;i<VerList.size();i++){
			 //纵向项目总到校金额
			 verReceive =verReceive+ VerList.get(i).getVerRec();
		 }
		 
		 /**项目总合同金额**/
		 allAccount = horAccount + verAccount;
		 /**项目总到校金额**/
		 allReceive = horReceive + verReceive;
		
		
		return SUCCESS;
	}
	
	
	
	/**
	 * @说明 项目经费统计查询
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public String accountQuery() throws Exception{
		
		if("".equals(proType)||null==proType){
			
			int pageSize1=0;
			
			if(currentPage<=0){
				currentPage=1;
			}
			if(pageSize<=0){
				pageSize=8;
			}
			if(pageSize%2==0){
			   pageSize1=pageSize/2;
			}else{
			   pageSize1=pageSize/2+1;
			}
			
		
			String hql1 = "from Horizontal where auditing != 0";
			String hql2 = "from Vertical where auditing != 0";
			 
		 try{
			 PageModel pmHor = this.getCommonService().findPage(hql1, null, currentPage, pageSize1-1, "projectQuery.action", "");
			 PageModel pmVer = this.getCommonService().findPage(hql2, null, currentPage, pageSize1, "projectQuery.action", "");
			 
			 /**分页参数*/
			 if((pmHor.getTotalCount()+ pmVer.getTotalCount() )%pageSize==0){
			 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize;
			 }else{
				 totalPage =( pmHor.getTotalCount()+ pmVer.getTotalCount() )/pageSize+1;
			 }
			 totalCount = pmHor.getTotalCount()+pmVer.getTotalCount();
			
			/*****查询条件***/
		 if(null!=proAccount&&!"".equals(proAccount)){
			 if("1".equals(proAccount)){
			   hql1 = hql1 + " and horAccount<5000  ";
			   hql2 = hql2 + " and verAccount<5000  ";
			 }
			 if("2".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 5000 and 15000  ";
				   hql2 = hql2 + " and verAccount between 5000 and 15000  ";
				 }
			 if("3".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 15000 and 30000";
				   hql2 = hql2 + " and verAccount between 15000 and 30000";
				 }
			 if("4".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 30000 and 50000";
				   hql2 = hql2 + " and verAccount between 30000 and 50000";
				 }
			 if("5".equals(proAccount)){
				   hql1 = hql1 +  " and horAccount between 50000 and 100000";
				   hql2 = hql2 +  " and verAccount between 50000 and 100000";
				 }
			 if("6".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 100000 and 200000";
				   hql2 = hql2 + " and verAccount between 100000 and 200000";
				 }
			 if("7".equals(proAccount)){
				   hql1 = hql1 + " and horAccount>200000";
				   hql2 = hql2 + " and verAccount>200000";
				 }
		 }
		 
		 if(null!=proReceive&&!"".equals(proReceive)){
			 if("1".equals(proReceive)){
			   hql1 = hql1 + " and horRec<5000  ";
			   hql2 = hql2 + " and verRec<5000  ";
			 }
			 if("2".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 5000 and 15000  ";
				   hql2 = hql2 + " and verRec between 5000 and 15000  ";
				 }
			 if("3".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 15000 and 30000";
				   hql2 = hql2 + " and verRec between 15000 and 30000";
				 }
			 if("4".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 30000 and 50000";
				   hql2 = hql2 + " and verRec between 30000 and 50000";
				 }
			 if("5".equals(proReceive)){
				   hql1 = hql1 +  " and horRec between 50000 and 100000";
				   hql2 = hql2 +  " and verRec between 50000 and 100000";
				 }
			 if("6".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 100000 and 200000";
				   hql2 = hql2 + " and verRec between 100000 and 200000";
				 }
			 if("7".equals(proReceive)){
				   hql1 = hql1 + " and horRec>200000";
				   hql2 = hql2 + " and verRec>200000";
				 }
		 }
		 
		 PageModel pm1 = this.getCommonService().findPage(hql1, null, currentPage, pageSize, "", "");
		 PageModel pm2 = this.getCommonService().findPage(hql2, null, currentPage, pageSize, "", "");
	
		 
		List<Horizontal> list1 = pm1.getList();
		List<Vertical> list2 = pm2.getList();
		
		 List<AllProject> list = new ArrayList<AllProject>();
		
			 	AllProject allProject = null;
				 for(Horizontal hor:list1){
					 allProject = new AllProject();
					 allProject.setProId(hor.getHorId());
					 allProject.setProTitle(hor.getHorTitle());
					 allProject.setProType("横向");
					// proType = "横向";
					 allProject.setProTime(hor.getHorTime());
					 allProject.setNum(hor.getHorNum());
					 allProject.setAccount(hor.getHorAccount());
					 allProject.setReceive(hor.getHorRec());
					 allProject.setPrincipal(hor.getHorPrincipal());
					 list.add(allProject);
				 }
			
				 for(Vertical ver:list2){
					 allProject = new AllProject();
					 allProject.setProId(ver.getVerId());
					 allProject.setProTitle(ver.getVerTitle());
					 allProject.setProType("纵向");
					 allProject.setProTime(ver.getVerTime());
					 allProject.setNum(ver.getVerNum());
					 allProject.setAccount(ver.getVerAccount());
					 allProject.setReceive(ver.getVerRec());
					 allProject.setPrincipal(ver.getVerPrincipal());
					 list.add(allProject);
				 }
				 ActionContext.getContext().put("list", list);
				 System.out.println("----------totalPage=="+totalPage+"totalCount=="+totalCount);
				 /*ServletActionContext.getRequest().setAttribute("sumProject", sumProject);
				 ServletActionContext.getRequest().setAttribute("sumVer", sumVer);
				 ServletActionContext.getRequest().setAttribute("sumHor", sumHor);
				 ServletActionContext.getRequest().setAttribute("allAccount", allAccount);
				 ServletActionContext.getRequest().setAttribute("verAccount", verAccount);
				 ServletActionContext.getRequest().setAttribute("horAccount", horAccount);
				 ServletActionContext.getRequest().setAttribute("verReceive", verReceive);
				 ServletActionContext.getRequest().setAttribute("horReceive", horReceive);
				 ServletActionContext.getRequest().setAttribute("allReceive", allReceive);*/
				 
				// ServletActionContext.getRequest().setAttribute("totalPage", totalPage);
				// ServletActionContext.getRequest().setAttribute("totalCount", totalCount);
		 }catch(Exception e){
			 e.printStackTrace();
		 }
		 
		}else if("横向".equals(proType)){
			//选择的是横向项目
			if(currentPage<=0){
				currentPage=1;
			}
			if(pageSize<=0){
				pageSize=15;
			}
		 String hql1 = "from Horizontal where auditing != 0";
			/*****查询条件***/
		 if(null!=proAccount&&!"".equals(proAccount)){
			 if("1".equals(proAccount)){
			   hql1 = hql1 + " and horAccount<5000  ";
			 }
			 if("2".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 5000 and 15000  ";
				 }
			 if("3".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 15000 and 30000";
				 }
			 if("4".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 30000 and 50000";
				 }
			 if("5".equals(proAccount)){
				   hql1 = hql1 +  " and horAccount between 50000 and 100000";
				 }
			 if("6".equals(proAccount)){
				   hql1 = hql1 + " and horAccount between 100000 and 200000";
				 }
			 if("7".equals(proAccount)){
				   hql1 = hql1 + " and horAccount>200000";
				 }
		 }
		 
		 if(null!=proReceive&&!"".equals(proReceive)){
			 if("1".equals(proReceive)){
			   hql1 = hql1 + " and horRec<5000  ";
			 }
			 if("2".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 5000 and 15000  ";
				 }
			 if("3".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 15000 and 30000";
				 }
			 if("4".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 30000 and 50000";
				 }
			 if("5".equals(proReceive)){
				   hql1 = hql1 +  " and horRec between 50000 and 100000";
				 }
			 if("6".equals(proReceive)){
				   hql1 = hql1 + " and horRec between 100000 and 200000";
				 }
			 if("7".equals(proReceive)){
				   hql1 = hql1 + " and horRec>200000";
				 }
		 }
		
		  pm = this.getCommonService().findPage(hql1, null, currentPage, pageSize, "projectQuery.action", "");
		   //分页参数
		  totalPage= pm.getTotalPage();
		  totalCount =pm.getTotalCount();
		  List<Horizontal> list1 = pm.getList();
			
			 List<AllProject> list = new ArrayList<AllProject>();
			
				 	AllProject allProject = null;
					 for(Horizontal hor:list1){
						 allProject = new AllProject();
						 allProject.setProId(hor.getHorId());
						 allProject.setProTitle(hor.getHorTitle());
						 allProject.setProType("横向");
						 allProject.setProTime(hor.getHorTime());
						 allProject.setNum(hor.getHorNum());
						 allProject.setAccount(hor.getHorAccount());
						 allProject.setReceive(hor.getHorRec());
						 allProject.setPrincipal(hor.getHorPrincipal());
						 list.add(allProject);
					 }
			ActionContext.getContext().put("list", list);
		 
		}else{
			//选择的是纵向项目
			if(currentPage<=0){
				currentPage=1;
			}
			if(pageSize<=0){
				pageSize=15;
		}
	   String hql2 = "from Vertical where auditing != 0";
		/*****查询条件***/
		 if(null!=proAccount&&!"".equals(proAccount)){
			 if("1".equals(proAccount)){
			   hql2 = hql2 + " and verAccount<5000  ";
			 }
			 if("2".equals(proAccount)){
				   hql2 = hql2 + " and verAccount between 5000 and 15000  ";
				 }
			 if("3".equals(proAccount)){
				   hql2 = hql2 + " and verAccount between 15000 and 30000";
				 }
			 if("4".equals(proAccount)){
				   hql2 = hql2 + " and verAccount between 30000 and 50000";
				 }
			 if("5".equals(proAccount)){
				   hql2 = hql2 +  " and verAccount between 50000 and 100000";
				 }
			 if("6".equals(proAccount)){
				   hql2 = hql2 + " and verAccount between 100000 and 200000";
				 }
			 if("7".equals(proAccount)){
				   hql2 = hql2 + " and verAccount>200000";
				 }
		 }
		 
		 if(null!=proReceive&&!"".equals(proReceive)){
			 if("1".equals(proReceive)){
			   hql2 = hql2 + " and verRec<5000  ";
			 }
			 if("2".equals(proReceive)){
				   hql2 = hql2 + " and verRec between 5000 and 15000  ";
				 }
			 if("3".equals(proReceive)){
				   hql2 = hql2 + " and verRec between 15000 and 30000";
				 }
			 if("4".equals(proReceive)){
				   hql2 = hql2 + " and verRec between 30000 and 50000";
				 }
			 if("5".equals(proReceive)){
				   hql2 = hql2 +  " and verRec between 50000 and 100000";
				 }
			 if("6".equals(proReceive)){
				   hql2 = hql2 + " and verRec between 100000 and 200000";
				 }
			 if("7".equals(proReceive)){
				   hql2 = hql2 + " and verRec>200000";
				 }
		 }
				
	   pm = this.getCommonService().findPage(hql2, null, currentPage, pageSize, "", "");
	   //分页参数
	   totalPage= pm.getTotalPage();
	   totalCount =pm.getTotalCount();
		List<Vertical> list2 = pm.getList();
		
		 List<AllProject> list = new ArrayList<AllProject>();
		
		 AllProject allProject = null;
		 for(Vertical ver:list2){
			 allProject = new AllProject();
			 allProject.setProId(ver.getVerId());
			 allProject.setProTitle(ver.getVerTitle());
			 allProject.setProType("纵向");
			 allProject.setProTime(ver.getVerTime());
			 allProject.setNum(ver.getVerNum());
			 allProject.setAccount(ver.getVerAccount());
			 allProject.setReceive(ver.getVerRec());
			 allProject.setPrincipal(ver.getVerPrincipal());
			 list.add(allProject);
		 }
		 ActionContext.getContext().put("list", list);		
		}
		return SUCCESS;
	}
	
	
	
	
	
	
	/**
	 * @说明 显示列表记录的详细信息
	 * @return
	 * @throws Exception
	 */
	public String itemDetail()throws Exception{
		System.out.println(proType+"54644444444444");
		if(proId==0||"".equals(proType)){
			return "login";
		}else{
		if("横向".equals(proType)){
			horId = proId;
			//String hql = "from Horizontal where horId='"+proId+"' ";
		horizontal = (Horizontal) this.getCommonService().findByIntId(horId, "gdut.jmxywz.been.Horizontal");
		ActionContext.getContext().put("horizontal", horizontal);
		}else{
			verId = proId;
			//String hql ="from Vertical where verId = '"+proId+"' ";
			vertical= (Vertical) this.getCommonService().findByIntId(verId, "gdut.jmxywz.been.Vertical");
		//	ActionContext.getContext().put("vertical", vertical);
		}
		
		return SUCCESS;
		}
	}
	
	
	
	
	
	
	/*****************setter and getter***********************/
	
	public PageModel getPm() {
		return pm;
	}
	public void setPm(PageModel pm) {
		this.pm = pm;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getNextPage() {
		return nextPage;
	}

	public void setNextPage(String nextPage) {
		this.nextPage = nextPage;
	}

	public Teacher getTeacher() {
		return teacher;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	public String getTeacherName() {
		return teacherName;
	}

	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}

	public Dissertation getDissertation() {
		return dissertation;
	}

	public void setDissertation(Dissertation dissertation) {
		this.dissertation = dissertation;
	}

	public int getDisId() {
		return disId;
	}

	public void setDisId(int disId) {
		this.disId = disId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor1() {
		return author1;
	}


	public void setAuthor1(String author1) {
		this.author1 = author1;
	}


	public String getEi() {
		return ei;
	}

	public void setEi(String ei) {
		this.ei = ei;
	}

	public String getSci() {
		return sci;
	}

	public void setSci(String sci) {
		this.sci = sci;
	}

	public String getIstp() {
		return istp;
	}

	public void setIstp(String istp) {
		this.istp = istp;
	}

	public String getCorePeriodical() {
		return corePeriodical;
	}

	public void setCorePeriodical(String corePeriodical) {
		this.corePeriodical = corePeriodical;
	}

	public Horizontal getHorizontal() {
		return horizontal;
	}

	public void setHorizontal(Horizontal horizontal) {
		this.horizontal = horizontal;
	}

	public int getHorId() {
		return horId;
	}

	public void setHorId(int horId) {
		this.horId = horId;
	}

	public Vertical getVertical() {
		return vertical;
	}

	public void setVertical(Vertical vertical) {
		this.vertical = vertical;
	}

	public int getVerId() {
		return verId;
	}

	public void setVerId(int verId) {
		this.verId = verId;
	}


	public AllProject getProject() {
		return allProject;
	}


	public void setProject(AllProject project) {
		this.allProject = project;
	}


	public int getProId() {
		return proId;
	}


	public void setProId(int proId) {
		this.proId = proId;
	}


	public AllProject getAllProject() {
		return allProject;
	}


	public void setAllProject(AllProject allProject) {
		this.allProject = allProject;
	}


	public String getProTitle() {
		return proTitle;
	}


	public void setProTitle(String proTitle) {
		this.proTitle = proTitle;
	}


	public String getProType() {
		return proType;
	}


	public void setProType(String proType) {
		this.proType = proType;
	}
	public String getNum() {
		return Num;
	}
	public void setNum(String num) {
		Num = num;
	}
	public Date getProTime() {
		return proTime;
	}
	public void setProTime(Date proTime) {
		this.proTime = proTime;
	}
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}


	public long getReceive() {
		return receive;
	}


	public void setReceive(long receive) {
		this.receive = receive;
	}


	public String getProAccount() {
		return proAccount;
	}


	public void setProAccount(String proAccount) {
		this.proAccount = proAccount;
	}


	public String getProReceive() {
		return proReceive;
	}


	public void setProReceive(String proReceive) {
		this.proReceive = proReceive;
	}


	public String getPrincipal() {
		return principal;
	}


	public void setPrincipal(String principal) {
		this.principal = principal;
	}


	public String getKeyword1() {
		return keyword1;
	}


	public void setKeyword1(String keyword1) {
		this.keyword1 = keyword1;
	}


	public String getKeyword2() {
		return keyword2;
	}


	public void setKeyword2(String keyword2) {
		this.keyword2 = keyword2;
	}


	public String getKeyword3() {
		return keyword3;
	}


	public void setKeyword3(String keyword3) {
		this.keyword3 = keyword3;
	}


	public String getCon1() {
		return con1;
	}


	public void setCon1(String con1) {
		this.con1 = con1;
	}


	public String getCon2() {
		return con2;
	}


	public void setCon2(String con2) {
		this.con2 = con2;
	}


	public String getCon3() {
		return con3;
	}


	public void setCon3(String con3) {
		this.con3 = con3;
	}


	public String getQuery1() {
		return query1;
	}


	public void setQuery1(String query1) {
		this.query1 = query1;
	}


	public String getQuery2() {
		return query2;
	}


	public void setQuery2(String query2) {
		this.query2 = query2;
	}


	public String getQuery3() {
		return query3;
	}


	public void setQuery3(String query3) {
		this.query3 = query3;
	}


	public String getConnect1() {
		return connect1;
	}


	public void setConnect1(String connect1) {
		this.connect1 = connect1;
	}


	public String getConnect2() {
		return connect2;
	}


	public void setConnect2(String connect2) {
		this.connect2 = connect2;
	}


	public long getSumPaper() {
		return sumPaper;
	}


	public void setSumPaper(long sumPaper) {
		this.sumPaper = sumPaper;
	}


	public long getSumSCI() {
		return sumSCI;
	}


	public void setSumSCI(long sumSCI) {
		this.sumSCI = sumSCI;
	}


	public long getSumEI() {
		return sumEI;
	}


	public void setSumEI(long sumEI) {
		this.sumEI = sumEI;
	}


	public long getSumISTP() {
		return sumISTP;
	}


	public void setSumISTP(long sumISTP) {
		this.sumISTP = sumISTP;
	}


	public long getSumCorePeriodical() {
		return sumCorePeriodical;
	}


	public void setSumCorePeriodical(long sumCorePeriodical) {
		this.sumCorePeriodical = sumCorePeriodical;
	}


	public int getSumProject() {
		return sumProject;
	}


	public void setSumProject(int sumProject) {
		this.sumProject = sumProject;
	}


	public int getSumVer() {
		return sumVer;
	}


	public void setSumVer(int sumVer) {
		this.sumVer = sumVer;
	}


	public int getSumHor() {
		return sumHor;
	}


	public void setSumHor(int sumHor) {
		this.sumHor = sumHor;
	}


	public long getAllAccount() {
		return allAccount;
	}


	public void setAllAccount(long allAccount) {
		this.allAccount = allAccount;
	}


	public long getVerAccount() {
		return verAccount;
	}


	public void setVerAccount(long verAccount) {
		this.verAccount = verAccount;
	}


	public long getHorAccount() {
		return horAccount;
	}


	public void setHorAccount(long horAccount) {
		this.horAccount = horAccount;
	}


	public long getAllReceive() {
		return allReceive;
	}


	public void setAllReceive(long allReceive) {
		this.allReceive = allReceive;
	}


	public long getVerReceive() {
		return verReceive;
	}


	public void setVerReceive(long verReceive) {
		this.verReceive = verReceive;
	}


	public long getHorReceive() {
		return horReceive;
	}


	public void setHorReceive(long horReceive) {
		this.horReceive = horReceive;
	}


	public int getTotalPage() {
		return totalPage;
	}


	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}


	public int getTotalCount() {
		return totalCount;
	}


	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	
}
